<template name="userprofile">
    <form class="form-horizontal">
    	{{#if flush}}
    		 <div class="list-errors">
                {{flush}}
            </div>
		{{/if}}

    	{{#if errorMessages}}
            <div class="list-errors">
                {{#each errorMessages}}
                <div class="list-item">{{this}}</div>
                {{/each}}
            </div>
        {{/if}}
        <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">部门</label>
            <div class="col-sm-10">
                <select id="dept" class="action-selects">
                    <option value="0">--部门--</option>
                    {{#each departments}}
						{{#if isEqual _id currUserProfile.departmentId}}
							<option value="{{_id}}" selected="selected">{{name}}</option>
						{{else}}
							<option value="{{_id}}">{{name}}</option>
						{{/if}}                    
                    {{/each}}
                </select>
            </div>
        </div>
        <div class="form-group">
            <label for="email" class="col-sm-2 control-label">邮箱</label>
            <div class="col-sm-10">
                <input type="email" class="form-control" id="email" value="{{currUserProfile.email}}" disabled="disabled">
            </div>
        </div>
        <div class="form-group">
            <label for="username" class="col-sm-2 control-label">姓名</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="username" placeholder="姓名" value="{{#if currUserProfile.username}}{{currUserProfile.username}}{{/if}}">
            </div>
        </div>
        <div class="form-group">
            <label for="cellphone" class="col-sm-2 control-label">手机</label>
            <div class="col-sm-10">
                <input type="tel" class="form-control" id="cellphone" placeholder="手机" value="{{#if currUserProfile.cellphone}}{{currUserProfile.cellphone}}{{/if}}">
            </div>
        </div>
        <div class="form-group">
            <label for="plateNO" class="col-sm-2 control-label">车牌号码</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="plateNO" placeholder="车牌号码" value="{{#if currUserProfile.plateNO}}{{currUserProfile.plateNO}}{{/if}}">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default">更新</button>
            </div>
        </div>
    </form>
</template>
